package com.cdd.job;

import org.quartz.*;
import org.springframework.stereotype.Component;

import java.util.Date;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
@Component
public class JobOne implements Job {

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap data=context.getTrigger().getJobDataMap();
        String invokeParam =(String) data.get("invokeParam");
        //在这里实现业务逻辑
        System.out.println("taskName=" + context.getJobDetail().getKey().getName() + "；执行时间="  + new Date());
    }
}
